RedVincularDemandante = function(){
	return {
		windowRedVincularDemandante: function(redDemandanteFolio){
			new Ext.Window({
				id: "windowRedVincularDemandante",
				layout: "fit", 
				title: " .::. VINCULACION DE DEMANDANTE .::.",
				modal: true,
				width: 850,
				height: 600,
				maximizable: true,
				resizable	: true,
	        	bodyStyle: "background: #DFE8F6",
	        	items: [{
	        		align: 'center',
					border: false,
					flex: 1,
					layout: {
						type: "hbox",
						align : "stretch",
						pack  : "start"
					},
					items:[
				       {
				        	width: 420,
				        	border: false,
				        	flex: 1,
				        	layout: {
								type: "vbox",
								align : "stretch",
								pack  : "start"
							},
							items: [
								{
									title: 'Criterios de Busqueda',
									xtype: 'grid',
									id: 'gridCriterios',
									frame: true,
									minHeight: 250,
									flex: 1,
									margins: "15 15 15 15",
									store: new Ext.data.SimpleStore({
										autoLoad:true,
										proxy: {
		                		            type: 'ajax',
		                		            url: Asg.constants.CONTEXT_PATH + "/red/demandante/viewCriteriosVinculacion",
		                		            reader: {
		                		                type: 'array',
		                		                root: 'criterios'
		                		            }
		                		        },
										fields: [
											"ctgCriterioVinculacionId",
											"ctgCriterioVinculacionNombre",
											"ctgCriterioVinculacionAccionSistema",
											"ctgCriterioVinculacionCalificacion",
											"ctgCriterioVinculacionChequeado"
								         ]
									}),
				        		 	columns: [
										{
											xtype:"checkcolumn",
											align: "center",
											dataIndex: "ctgCriterioVinculacionChequeado", 
											width: 30
										},
			  		        	        {header: "Cod", dataIndex: "ctgCriterioVinculacionId",width: 30},
			  		        	        {header: "Punteo", dataIndex: "ctgCriterioVinculacionCalificacion",width: 50},
			  		        	        {header: "Accion", dataIndex: "ctgCriterioVinculacionAccionSistema",width: 90, renderer: "webRendererAccion"},
			  		        	        {header: "Criterio", dataIndex: "ctgCriterioVinculacionNombre",width: 100, flex:1}
									],
									selModel:{
				        	            listeners: {
				        	            	selectionchange: function(selectionModel, rows){
				        	            		if(rows && rows.length > 0){
				        	            			
				        	            		}
				        	            	}
				        	            }
									}
								}
							]
				       }, {
				        	width: 420,
				        	border: false,
				        	flex: 1,
				        	layout: {
								type: "vbox",
								align : "stretch",
								pack  : "start"
							},
							items: [{
								xtype: "form",
								id: "informacionDemandanteForm",
								title: "Informacion del Demandante",
								margins: "15 15 15 15",
								frame: true,
								minHeight: 250,
								flex: 1,
								layout: {
		        	        		type: "table",
									columns: 2,
									tableAttrs: {
							            style: {width: "520px"},
							            align: "center"
									}
		        	        	},
		        	        	defaults: Asg.Form.defaults({width: 255}),
								items:[
							       	{xtype: "label", text: "Folio:", cls: "x-form-item", colspan: 2},
							       	{xtype: "label", text: "Nombre:", cls: "x-form-item", colspan: 2},
							       	{xtype: "label", text: "Municipio:", cls: "x-form-item", colspan: 2},
							       	{xtype: "label", text: "Edad:", cls: "x-form-item", colspan: 2},
							       	{xtype: "label", text: "Salario:", cls: "x-form-item", colspan: 2},
							       	{xtype: "label", text: "\u00BFDiscapacitado\u003F:", cls: "x-form-item", colspan: 2},
							       	{xtype: "label", text: "\u00BFTiene Trabajo\u003F:", cls: "x-form-item", colspan: 2},
							       	{xtype: "label", text: "Censante desde:", cls: "x-form-item", colspan: 2},
							       	{xtype: "label", text: "Busca desde:", cls: "x-form-item", colspan: 2},
							       	{xtype: "label", text: "Oficio:", cls: "x-form-item", colspan: 2},
							       	{xtype: "label", text: "Ocupaci\u00F3n:", cls: "x-form-item", colspan: 2},
							       	{xtype: "hidden", colspan:4},
							       	{xtype: "hidden", colspan:4},
							       	{
		    	                        xtype: "button",
		    	                        id: "btnActivar",
		    	                        columnWidth: 375,
		    	                        width: 375,
		    	                        text: "<b> M\u00E1s informaci\u00F3n del Demandante </b>",
		    	                        colspan: 2,
		    	                        flex: 1,
		    	                        handler: function(){
	    	                        		RedActivacionEmpresa.activarEmpresa("1",jsonObject.activacion.redEmpresaFolio);
		    	                        }
		    	                    }
							       	
						        ]
							}]
				       }
			        ]
	        	}]
			}).show();
		}
	};
}();
